<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
           let students = [
        { name: '东东', sex: '男', html: 80, css: 90, js: 80 },
        { name: '丽丽', sex: '女', html: 88, css: 90, js: 80 },
        { name: '文文', sex: '女', html: 84, css: 96, js: 59 },
        { name: '珊珊', sex: '女', html: 80, css: 90, js: 77 },
        { name: '海浪', sex: '男', html: 40, css: 87, js: 96 },
        { name: '月月', sex: '女', html: 80, css: 19, js: 80 },
      ]
         // 找出所有的女同学，并且添加score属性统计每个女同学他们所有科目的总分 ,数据如下：
         //先找到所有女生
         let result =students.filter((item) =>  item.sex === '女')

         .map((item) => {
            let{html,css,js} =item
            item.score = html+css+js
            return item
         })
         console.log(result)
    </script>
  </body>
</html>
